PFont fonte;

void setup() {
  size(640,640);
  fonte = loadFont("Times-Roman-32.vlw");
  textFont(fonte,32);
}

void draw() {
  int x = mouseX;
  int y = mouseY;
  int xTexto = x;
  int yTexto = y;
  background(128);
  stroke(255,0,0);
  line(x,0,x,height);
  stroke(0,0,255);
  line(0,y,width,y);
  if (x >= 535) {
    xTexto = x-105;
  }
  if (y <= 23) {
    yTexto = y+23;
  }
  text(x+","+y, xTexto, yTexto);
}


